#ifndef TASKLIST_H
#define TASKLIST_H

#include <QFrame>
#include <QTimer>

class QVBoxLayout;
class UKUIWindow;
class UKUITaskbarPreviewWidget;

//不做数据管理，只负责展示数据
class TaskList: public QFrame
{
    Q_OBJECT
public:

    explicit TaskList(QWidget* parent = 0);
    ~TaskList();

    void setData(QMap<UKUIWindow*, UKUITaskbarPreviewWidget*> &mapWindowPreview);

    void hide(bool fast = false);

protected:
    void enterEvent(QEvent * event);

    void leaveEvent(QEvent * event);


public slots:
    //add or remove window
    void dataChanged();

    void closeTimerSlot();


private:
    void initUI();

    QMap<UKUIWindow*, UKUITaskbarPreviewWidget*> *m_mapWindowPreview;
    QVBoxLayout *m_layout;
    QTimer mCloseTimer;
};

#endif // TASKLIST_H
